const express = require('express');
const router = express.Router();
const newsService = require('../service/user/newsService');
const newsManageService = require('../service/admin/newsManageService');
const {verifyToken, verifyAdminToken} = require('../middleware/auth')

router.post('/get', verifyToken, newsService.getNews)
router.post('/get/by/id', verifyToken, newsService.getNewsById)

/**
 * Admin Enter->
 */
router.post('/admin/get', verifyAdminToken, newsService.getNews)
router.post('/admin/add', verifyAdminToken, newsManageService.addNews)
router.post('/admin/delete', verifyAdminToken, newsManageService.deleteNewById)
router.post('/admin/update/status', verifyAdminToken, newsManageService.updateNewsStatus)

module.exports = router;
